package oom;
/**
 * 常量池溢出
 * jdk7 intern()实现不会在复制实例，只是在常量池中记录首次出现的实例引用
 * @author Ditto
 *
 */

public class RuntimeConstantPoolOOM {

	public static void main(String[] args) {
		String str1 = new StringBuilder("计算机").append("软件").toString();
		System.out.println(str1.intern() == str1);
		String str2 = new StringBuilder("ja").append("va").toString();
		System.out.println(str2.intern() == str2);
	}
}
